home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 July: Mac OS SDK / Dev.CD Jul 96 SDK / Dev.CD Jul 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / ODF / Framewrk / FWPart / Include / FWUtil.h < prev    next >
Encoding:
Text File  |  1996-04-25  |  4.9 KB  |  136 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWUtil.h
  4. //    Release Version:    $ ODF 1 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FWUTIL_H
  11. #define FWUTIL_H
  12.  
  13. #ifndef _STORUTIL_
  14. #include <StorUtil.h>
  15. #endif
  16.  
  17. // ----- OpenDoc Includes -----
  18.  
  19. #ifndef FWODTYPS_H
  20. #include "FWODTyps.h"
  21. #endif
  22.  
  23. #ifndef SOM_ODRefCntObject_xh
  24. #include <RefCtObj.xh>
  25. #endif
  26.  
  27. //========================================================================================
  28. //    Forward Declarations
  29. //========================================================================================
  30.  
  31. class ODShape;
  32. class ODStorageUnit;
  33. class ODFrame;
  34.  
  35. class FW_CFrame;
  36. class FW_CPoint;
  37. class FW_CRect;
  38.  
  39. //========================================================================================
  40. //    Storage Utilities
  41. //========================================================================================
  42.  
  43. FW_Boolean FW_SUExistsThenFocus(Environment* ev, 
  44.                                 ODStorageUnit* su, 
  45.                                 ODPropertyName prop,
  46.                                 ODValueType val);
  47. void FW_SUForceFocus(Environment* ev, 
  48.                                 ODStorageUnit* su, 
  49.                                 ODPropertyName prop, 
  50.                                 ODValueType val);
  51. void FW_SUAddPropValue(Environment* ev, 
  52.                                 ODStorageUnit* su, 
  53.                                 ODPropertyName prop, 
  54.                                 ODValueType val);
  55. void FW_SURemoveProperty(Environment* ev, 
  56.                                 ODStorageUnit* su, 
  57.                                 ODPropertyName prop);
  58.  
  59. //========================================================================================
  60. // utilities
  61. //========================================================================================
  62.  
  63. FW_Boolean FW_IsInLimbo(Environment* ev, ODFrame* frame);
  64.  
  65. //========================================================================================
  66. //    Coordinate conversion utilities
  67. //========================================================================================
  68.  
  69. void FW_ContentToFrame(Environment* ev, ODFrame* frame, ODShape* shape);
  70. void FW_FrameToContent(Environment* ev, ODFrame* frame, ODShape* shape);
  71. void FW_ContentToFrame(Environment* ev, ODFrame* frame, FW_CPoint& point);
  72. void FW_FrameToContent(Environment* ev, ODFrame* frame, FW_CPoint& point);
  73. void FW_ContentToFrame(Environment* ev, ODFrame* frame, FW_CRect& rect);
  74. void FW_FrameToContent(Environment* ev, ODFrame* frame, FW_CRect& rect);
  75.  
  76. void FW_ContentToWindow(Environment* ev, ODFacet* facet, ODShape* shape);
  77. void FW_WindowToContent(Environment* ev, ODFacet* facet, ODShape* shape);
  78. void FW_ContentToWindow(Environment* ev, ODFacet* facet, FW_CPoint& point);
  79. void FW_WindowToContent(Environment* ev, ODFacet* facet, FW_CPoint& point);
  80. void FW_ContentToWindow(Environment* ev, ODFacet* facet, FW_CRect& rect);
  81. void FW_WindowToContent(Environment* ev, ODFacet* facet, FW_CRect& rect);
  82.  
  83. void FW_FrameToWindow(Environment* ev, ODFacet* facet, ODShape* shape);
  84. void FW_WindowToFrame(Environment* ev, ODFacet* facet, ODShape* shape);
  85. void FW_FrameToWindow(Environment* ev, ODFacet* facet, FW_CPoint& point);
  86. void FW_WindowToFrame(Environment* ev, ODFacet* facet, FW_CPoint& point);
  87. void FW_FrameToWindow(Environment* ev, ODFacet* facet, FW_CRect& rect);
  88. void FW_WindowToFrame(Environment* ev, ODFacet* facet, FW_CRect& rect);
  89.  
  90. //========================================================================================
  91. //    Global Inline Methods
  92. //========================================================================================
  93.  
  94. //----------------------------------------------------------------------------------------
  95. // FW_ReleaseODObject
  96. //----------------------------------------------------------------------------------------
  97. inline void FW_ReleaseODObject(Environment* ev, ODRefCntObject* odObject)
  98. {
  99.     if (odObject)
  100.         odObject->Release(ev);
  101. }
  102.  
  103. //----------------------------------------------------------------------------------------
  104. // FW_SUForceFocus
  105. //----------------------------------------------------------------------------------------
  106. inline void FW_SUForceFocus(Environment* ev, 
  107.                             ODStorageUnit* su, 
  108.                             ODPropertyName prop, 
  109.                             ODValueType val)
  110. {
  111.     ODSUForceFocus(ev, su, prop, val);
  112. }
  113.  
  114. //----------------------------------------------------------------------------------------
  115. // FW_SUExistsThenFocus
  116. //----------------------------------------------------------------------------------------
  117. inline FW_Boolean FW_SUExistsThenFocus(Environment* ev, 
  118.                                         ODStorageUnit* su, 
  119.                                         ODPropertyName prop, 
  120.                                         ODValueType val)
  121. {
  122.     return ODSUExistsThenFocus(ev, su, prop, val);
  123. }
  124.  
  125. //----------------------------------------------------------------------------------------
  126. // FW_SURemoveProperty
  127. //----------------------------------------------------------------------------------------
  128. inline void FW_SURemoveProperty(Environment* ev, 
  129.                                 ODStorageUnit* su, 
  130.                                 ODPropertyName prop)
  131. {
  132.     ODSURemoveProperty(ev, su, prop);
  133. }
  134.  
  135. #endif
  136.